/*
//	CP2013 Traffic Simulator Assignment :: (MVC) Model :: Direction Struct (Function Definitions)
//	Copyright (c) 2010, Adam Rehn
//
//	This file contains the function definitions for this component.
*/
#include "direction.h"

//Constructor
direction_t::direction_t(int x, int y)
{
	this->x = x;
	this->y = y;
}

//Overloaded comparison operator for coordinates
bool operator==(direction_t left, direction_t right)
{
	return (left.x == right.x) && (left.y == right.y);
}

bool operator!=(direction_t left, direction_t right)
{
	return !(left == right);
}

//Overloaded multiplication operator for directions
direction_t operator*(direction_t dir, int multiplyBy)
{
	//Multiply both the x and y values by multiplyBy
	return direction_t(dir.x * multiplyBy, dir.y * multiplyBy);
}

direction_t operator*(int multiplyBy, direction_t dir)
{
	//Use the other version of this function
	return (dir * multiplyBy);
}
